package com.fesine.learn.design.principle.compositionaggregation;

/**
 * @description: 类描述
 * @author: fesine
 * @createTime:2019/2/16
 * @update:修改内容
 * @author: fesine
 * @updateTime:2019/2/16
 */
//public class ProductDao extends DBConnection {
public class ProductDao {

    private DBConnection dbConnection;

    //public void addProduct(){
    //    String conn = super.getConnection();
    //    System.out.println("使用"+conn+"添加商品");
    //}


    public void setDbConnection(DBConnection dbConnection) {
        this.dbConnection = dbConnection;
    }

    public void addProduct(){
            String conn = dbConnection.getConnection();
            System.out.println("使用"+conn+"添加商品");
    }
}
